package com.tsu.mall.order.Controller;

import com.tsu.mall.common.VO.WaresClassifyVO;
import com.tsu.mall.common.entity.Wares;
import com.tsu.mall.common.entity.Waresclassify;
import com.tsu.mall.common.service.IWaresService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
@RequestMapping("/")
public class WaresClassifyController {
    @Autowired
    private IWaresService iWaresService;
    @GetMapping("/waresClassifyList")
    @ResponseBody
    public List<WaresClassifyVO> getWaresClassify(){
        return iWaresService.selectClassifyList();
    }

    @GetMapping("/shopLeftSidebarPage")
    public String shopLeftSidebarPage(Integer id, Model model){
        model.addAttribute("secondId",id);
        return "shop-left-sidebar";
    }
}
